﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TesteOnline.Model
{
    public class Question
    {
        public Question(string text, bool correct)
        {
            this.Text = text;
            this.Correct = correct;
        }

        public String Text { get; set; }
        public bool Correct { get; set; }
        public int Result { get; set; }
       
        public void SetAnswers(int[] answers)
        {
            this.Result = 0;
            if (answers.Length == 1)
            {
                if (( answers[0] == 1) && (this.Correct ))
                {
                    this.Result = 1;
                }
                else if ((answers[0] == 2) && (!this.Correct))
                {
                    this.Result = 1;
                }
                else
                {
                    this.Result = -1;
                }
            }
        }
    }
}